#import "~/graphql_shared/fragments/page_info.fragment.graphql"
#import "../fragments/upload_state.fragment.graphql"

query getCorpuses(
  $projectPath: ID!
  $beforeCursor: String = ""
  $afterCursor: String = ""
  $firstPageSize: Int
  $lastPageSize: Int
) {
  project(fullPath: $projectPath) {
    id
    corpuses(
      before: $beforeCursor
      after: $afterCursor
      first: $firstPageSize
      last: $lastPageSize
    ) {
      nodes {
        id
        package {
          id
          name
          updatedAt
          packageFiles(first: 1) {
            nodes {
              id
              size
              downloadPath
            }
          }
          pipelines(first: 1) {
            nodes {
              id
              createdAt
              ref
              path
              updatedAt
            }
          }
        }
      }
      pageInfo {
        ...PageInfo
      }
    }
  }
  uploadState @client {
    ...UploadState
  }
}
